//
//  BingTouchController.m
//  BallRankingProject
//
//  Created by lanou3g on 15/6/2.
//  Copyright (c) 2015年 luojian. All rights reserved.
//

#import "BingTouchController.h"
#import "UIImageView+WebCache.h"
@interface BingTouchController ()

@end

@implementation BingTouchController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UITextView *textView=[[UITextView alloc] initWithFrame:self.view.frame];
    self.view=textView;
    self.navigationController.navigationBar.translucent = NO;
    UIBarButtonItem *leftBI=[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Back"] style:(UIBarButtonItemStyleDone) target:self action:@selector(goBackTo:)];
    self.navigationItem.leftBarButtonItem=leftBI;
    leftBI.tintColor=[UIColor whiteColor];
    
    [self getMessage];
    [self buidViewLable];
    [self firstType];
    if (_array.count>1) {
        [self secondType];
    }
    
}
- (void)goBackTo:(UIBarButtonItem *)BI
{
    
    
    CATransition *transition=[CATransition animation];
    transition.duration=10.0f;
    transition.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    transition.type=kCATransitionPush;
    transition.subtype=kCATransitionFromTop;
    transition.delegate=self;
   // [self.view.layer removeAllAnimations];
    [self.view.layer addAnimation:transition forKey:nil];
//self.navigationController.navigationBar.translucent=YES;
    [self.navigationController popViewControllerAnimated:YES];

}
//请求数据
- (void)getMessage
{
    NSString *string=[NSString stringWithFormat:@"%@%@",CHLGMICS,_str];
    NSURL *url=[NSURL URLWithString:string];
    NSData *data=[NSData dataWithContentsOfURL:url];
    if (data==nil) {
        
        return ;
    }
 NSDictionary *dic=[NSJSONSerialization JSONObjectWithData:data options:(NSJSONReadingMutableContainers) error:nil];
    NSDictionary *dic2=[dic objectForKey:@"result"];
    self.upDict=[dic2 objectForKey:@"profile"];
    //得到数组,数组里面有两个字典
    self.array=[dic2 objectForKey:@"stats"];
    _webView.backgroundColor=[UIColor greenColor];

}
-(void)buidViewLable
{
//表格以上的布局
    self.imagesView=[[UIImageView alloc] initWithFrame:CGRectMake(10, 5, CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4-10)];
    self.allNameLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.frame)/3+20, 0, CGRectGetWidth(self.view.frame)/3*2, CGRectGetHeight(_imagesView.frame)/3)];
    self.englishNamaLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.frame)/3+20, CGRectGetHeight(_imagesView.frame)/3, CGRectGetWidth(self.view.frame)/3+20, CGRectGetHeight(_imagesView.frame)/3)];
    self.numberLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.frame)/3+20, CGRectGetHeight(_imagesView.frame)/3*2, CGRectGetWidth(self.view.frame)/3+70, CGRectGetHeight(_imagesView.frame)/3)];
    UILabel *bigLable=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(self.view.frame)/4, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)/8)];
    self.ageLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(bigLable.frame)/3, CGRectGetHeight(bigLable.frame))];
    self.heightLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(bigLable.frame)/3, 0, CGRectGetWidth(bigLable.frame)/3, CGRectGetHeight(bigLable.frame))];
    self.weigheLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(bigLable.frame)/3*2, 0, CGRectGetWidth(bigLable.frame)/3, CGRectGetHeight(bigLable.frame))];
    UILabel *agelable=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_ageLabel.frame)/2, CGRectGetWidth(bigLable.frame)/3, CGRectGetHeight(bigLable.frame)/2)];
    UILabel *heightlable=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(bigLable.frame)/2, CGRectGetWidth(bigLable.frame)/3, CGRectGetHeight(bigLable.frame)/2)];
    UILabel *weightlable=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(bigLable.frame)/2, CGRectGetWidth(bigLable.frame)/3, CGRectGetHeight(bigLable.frame)/2)];
    heightlable.text=@"身高";
    agelable.text=@"年龄";
    weightlable.text=@"体重";
    agelable.textAlignment=1;
    heightlable.textAlignment=1;
    weightlable.textAlignment=1;
    agelable.font=[UIFont systemFontOfSize:12.0];
    heightlable.font=[UIFont systemFontOfSize:12.0];
    weightlable.font=[UIFont systemFontOfSize:12.0];
    //heightlable.backgroundColor=[UIColor whiteColor];
    
    _ageLabel.textAlignment=1;
    _heightLable.textAlignment=1;
    _weigheLable.textAlignment=1;
    [_ageLabel addSubview:agelable];
    [_heightLable addSubview:heightlable];
    [_weigheLable addSubview:weightlable];
    [bigLable addSubview:_ageLabel];
    [bigLable addSubview:_heightLable];
    [bigLable addSubview:_weigheLable];
    _ageLabel.layer.borderWidth=1;
    _ageLabel.layer.borderColor=[UIColor redColor].CGColor;
    _heightLable.layer.borderWidth=1;
    _heightLable.layer.borderColor=[UIColor redColor].CGColor;
    _weigheLable.layer.borderWidth=1;
    _weigheLable.layer.borderColor=[UIColor redColor].CGColor;
    [self.view addSubview:bigLable];
    [self.view addSubview:_imagesView];
    [self.view addSubview:_allNameLable];
    [self.view addSubview:_englishNamaLable];
    [self.view addSubview:_numberLable];
    
    //表格上面布局结束
    //赋值
    BallPalayer *ballPlayer=[[BallPalayer alloc] init];
    [ballPlayer setValuesForKeysWithDictionary:_upDict];
    _ageLabel.text=ballPlayer.age;
    _heightLable.text=ballPlayer.height;
    _weigheLable.text=ballPlayer.weight;
    _allNameLable.text=ballPlayer.player_full_name;
    _englishNamaLable.text=ballPlayer.player_enname;
    NSURL *url=[NSURL URLWithString:ballPlayer.player_header];
    [_imagesView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"placeHold"]];
    _numberLable.text=ballPlayer.number;
    
    //赋值结束
    
    //网络文本
    self.webView=[[UIWebView alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(self.view.frame)/4+CGRectGetHeight(bigLable.frame), CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)/8)];
     _webView.scrollView.bounces=NO;
    NSString *string2=[_upDict objectForKey:@"detail"];
    [_webView loadHTMLString:string2 baseURL:nil];
    [self.view addSubview:_webView];
    
    //结束
    
    
    


}
//第一个表格
-(void)firstType
{

    //下面的第一个表格
    
    self.view.backgroundColor=[UIColor colorWithRed:0.641 green:0.949 blue:1.000 alpha:1.000];
    self.titleLable=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(self.view.frame)/4*2, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)/4/3)];
    _titleLable.layer.borderWidth=1;
    _titleLable.layer.borderColor=[UIColor colorWithRed:1.000 green:0.159 blue:0.923 alpha:1.000].CGColor;
    _titleLable.backgroundColor=[UIColor colorWithRed:0.266 green:0.997 blue:1.000 alpha:1.000];
    self.countLable=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(self.view.frame)/4*2+CGRectGetHeight(self.view.frame)/4/3, CGRectGetWidth(self.view.frame)/3,CGRectGetHeight(self.view.frame)/4/3)];
    self.timeLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4*2+CGRectGetHeight(self.view.frame)/4/3, CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4/3)];
    self.ballLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.frame)/3*2, CGRectGetHeight(self.view.frame)/4*2+CGRectGetHeight(self.view.frame)/4/3, CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4/3)];
    self.assisLable=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(self.view.frame)/4*2+CGRectGetHeight(self.view.frame)/4/3*2, CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4/3)];
    self.redLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4*2+CGRectGetHeight(self.view.frame)/4/3*2, CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4/3)];
    self.yellowLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.frame)/3*2, CGRectGetHeight(self.view.frame)/4*2+CGRectGetHeight(self.view.frame)/4/3*2, CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4/3)];
    _countLable.layer.borderWidth=0.5;
    _countLable.layer.borderColor=[UIColor colorWithRed:0.190 green:0.988 blue:0.080 alpha:1.000].CGColor;
    _timeLable.layer.borderWidth=0.5;
    _timeLable.layer.borderColor=[UIColor colorWithRed:0.190 green:0.988 blue:0.080 alpha:1.000].CGColor;
    _ballLable.layer.borderWidth=0.5;
    _ballLable.layer.borderColor=[UIColor colorWithRed:0.190 green:0.988 blue:0.080 alpha:1.000].CGColor;
    _assisLable.layer.borderWidth=0.5;
    _assisLable.layer.borderColor=[UIColor colorWithRed:0.190 green:0.988 blue:0.080 alpha:1.000].CGColor;
    _redLable.layer.borderWidth=0.5;
    _redLable.layer.borderColor=[UIColor colorWithRed:0.190 green:0.988 blue:0.080 alpha:1.000].CGColor;
    _yellowLable.layer.borderWidth=0.5;
    _yellowLable.layer.borderColor=[UIColor colorWithRed:0.190 green:0.988 blue:0.080 alpha:1.000].CGColor;
    [self.view addSubview:_allNameLable];
    [self.view addSubview:_englishNamaLable];
    [self.view addSubview:_numberLable];
    [self.view addSubview:_titleLable];
    [self.view addSubview:_countLable];
    [self.view addSubview:_timeLable];
    [self.view addSubview:_ballLable];
    [self.view addSubview:_assisLable];
    [self.view addSubview:_redLable];
    [self.view addSubview:_yellowLable];
    [self.view addSubview:_imagesView];
    UILabel *upLable1=[[UILabel alloc] initWithFrame:CGRectMake(0, 0,CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *upLable2=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *upLable3=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *upLable4=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *upLable5=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *upLable6=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    
    UILabel *downLable1=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_countLable.frame)/2,CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *downLable2=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_countLable.frame)/2, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *downLable3=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_countLable.frame)/2, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *downLable4=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_countLable.frame)/2, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2-10)];
    UILabel *downLable5=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_countLable.frame)/2, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2-10)];
    UILabel *downLable6=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_countLable.frame)/2, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2-10)];
    [_countLable addSubview:upLable1];
    [_countLable addSubview:downLable1];
    [_timeLable addSubview:upLable2];
    [_timeLable addSubview:downLable2];
    [_ballLable addSubview:upLable3];
    [_ballLable addSubview:downLable3];
    [_assisLable addSubview:upLable4];
    [_assisLable addSubview:downLable4];
    [_redLable addSubview:upLable5];
    [_redLable addSubview:downLable5];
    [_yellowLable addSubview:upLable6];
    [_yellowLable addSubview:downLable6];
    downLable6.textAlignment=1;
    downLable5.textAlignment=1;
    downLable4.textAlignment=1;
    downLable3.textAlignment=1;
    downLable2.textAlignment=1;
    downLable1.textAlignment=1;
    downLable6.font=[UIFont systemFontOfSize:12.0];
    downLable5.font=[UIFont systemFontOfSize:12.0];
    downLable4.font=[UIFont systemFontOfSize:12.0];
    downLable3.font=[UIFont systemFontOfSize:12.0];
    downLable2.font=[UIFont systemFontOfSize:12.0];
    downLable1.font=[UIFont systemFontOfSize:12.0];
    upLable6.textAlignment=1;
    upLable5.textAlignment=1;
    upLable4.textAlignment=1;
    upLable3.textAlignment=1;
    upLable2.textAlignment=1;
    upLable1.textAlignment=1;
    
    //对第一个表格赋值
    NSDictionary *dic3=_array[0];
    self.arr=[dic3 objectForKey:@"data"];
    downLable6.textColor=[UIColor yellowColor];
    downLable5.textColor=[UIColor redColor];
    downLable1.textColor=[UIColor colorWithRed:0.959 green:0.136 blue:1.000 alpha:1.000];
    downLable2.textColor=[UIColor colorWithRed:0.959 green:0.136 blue:1.000 alpha:1.000];
    downLable3.textColor=[UIColor colorWithRed:0.959 green:0.136 blue:1.000 alpha:1.000];
    downLable4.textColor=[UIColor colorWithRed:0.959 green:0.136 blue:1.000 alpha:1.000];
    downLable1.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[0]][0]];
    downLable2.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[1]][0]];
    downLable3.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[2]][0]];
    downLable4.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[3]][0]];
    downLable5.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[4]][0]];
    downLable6.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[5]][0]];
    upLable1.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[0]][1]];
    upLable2.text= [NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[1]][1]];
    upLable3.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[2]][1]];
    upLable4.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[3]][1]];
    upLable5.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[4]][1]];
    upLable6.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[5]][1]];
    _titleLable.text=[dic3 objectForKey:@"block"];




}

//第二个表格
- (void)secondType
{
  UILabel   *twotitleLable=[[UILabel alloc] initWithFrame:CGRectMake(0,CGRectGetMaxY(_assisLable.frame), CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)/4/3)];
    twotitleLable.layer.borderWidth=1;
    twotitleLable.layer.borderColor=[UIColor colorWithRed:1.000 green:0.159 blue:0.923 alpha:1.000].CGColor;
    twotitleLable.backgroundColor=[UIColor colorWithRed:0.266 green:0.997 blue:1.000 alpha:1.000];
    UILabel  *twocountLable=[[UILabel alloc] initWithFrame:CGRectMake(0,CGRectGetMaxY(twotitleLable.frame), CGRectGetWidth(self.view.frame)/3,CGRectGetHeight(self.view.frame)/4/3)];
    UILabel  *twotimeLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.frame)/3,CGRectGetMaxY(twotitleLable.frame), CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4/3)];
  UILabel *twoballLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.frame)/3*2, CGRectGetMaxY(twotitleLable.frame), CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4/3)];
   UILabel  *twoassisLable=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(twocountLable.frame), CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4/3)];
   UILabel  *tworedLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.frame)/3, CGRectGetMaxY(twocountLable.frame), CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4/3)];
   UILabel  *twoyellowLable=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.view.frame)/3*2, CGRectGetMaxY(twocountLable.frame), CGRectGetWidth(self.view.frame)/3, CGRectGetHeight(self.view.frame)/4/3)];
    twocountLable.layer.borderWidth=0.5;
    twocountLable.layer.borderColor=[UIColor colorWithRed:0.190 green:0.988 blue:0.080 alpha:1.000].CGColor;
    twotimeLable.layer.borderWidth=0.5;
    twotimeLable.layer.borderColor=[UIColor colorWithRed:0.190 green:0.988 blue:0.080 alpha:1.000].CGColor;
    twoballLable.layer.borderWidth=0.5;
    twoballLable.layer.borderColor=[UIColor colorWithRed:0.190 green:0.988 blue:0.080 alpha:1.000].CGColor;
    twoassisLable.layer.borderWidth=0.5;
    twoassisLable.layer.borderColor=[UIColor colorWithRed:0.190 green:0.988 blue:0.080 alpha:1.000].CGColor;
    tworedLable.layer.borderWidth=0.5;
    tworedLable.layer.borderColor=[UIColor colorWithRed:0.190 green:0.988 blue:0.080 alpha:1.000].CGColor;
    twoyellowLable.layer.borderWidth=0.5;
    twoyellowLable.layer.borderColor=[UIColor colorWithRed:0.190 green:0.988 blue:0.080 alpha:1.000].CGColor;
    
    [self.view addSubview:twotitleLable];
    [self.view addSubview:twocountLable];
    [self.view addSubview:twotimeLable];
    [self.view addSubview:twoballLable];
    [self.view addSubview:twoassisLable];
    [self.view addSubview:tworedLable];
    [self.view addSubview:twoyellowLable];
    UILabel *upLable1=[[UILabel alloc] initWithFrame:CGRectMake(0, 0,CGRectGetWidth(twocountLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *upLable2=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *upLable3=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *upLable4=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *upLable5=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *upLable6=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    
    UILabel *downLable1=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_countLable.frame)/2,CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *downLable2=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_countLable.frame)/2, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *downLable3=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_countLable.frame)/2, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2)];
    UILabel *downLable4=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_countLable.frame)/2, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2-10)];
    UILabel *downLable5=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_countLable.frame)/2, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2-10)];
    UILabel *downLable6=[[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(_countLable.frame)/2, CGRectGetWidth(_countLable.frame), CGRectGetHeight(_countLable.frame)/2-10)];
    [twocountLable addSubview:upLable1];
    [twocountLable addSubview:downLable1];
    [twotimeLable addSubview:upLable2];
    [twotimeLable addSubview:downLable2];
    [twoballLable addSubview:upLable3];
    [twoballLable addSubview:downLable3];
    [twoassisLable addSubview:upLable4];
    [twoassisLable addSubview:downLable4];
    [tworedLable addSubview:upLable5];
    [tworedLable addSubview:downLable5];
    [twoyellowLable addSubview:upLable6];
    [twoyellowLable addSubview:downLable6];
    downLable6.textAlignment=1;
    downLable5.textAlignment=1;
    downLable4.textAlignment=1;
    downLable3.textAlignment=1;
    downLable2.textAlignment=1;
    downLable1.textAlignment=1;
    downLable6.font=[UIFont systemFontOfSize:12.0];
    downLable5.font=[UIFont systemFontOfSize:12.0];
    downLable4.font=[UIFont systemFontOfSize:12.0];
    downLable3.font=[UIFont systemFontOfSize:12.0];
    downLable2.font=[UIFont systemFontOfSize:12.0];
    downLable1.font=[UIFont systemFontOfSize:12.0];
    upLable6.textAlignment=1;
    upLable5.textAlignment=1;
    upLable4.textAlignment=1;
    upLable3.textAlignment=1;
    upLable2.textAlignment=1;
    upLable1.textAlignment=1;


    //对第2个表格赋值
       NSDictionary *dic3=_array[1];
     self.arr=[dic3 objectForKey:@"data"];
    downLable6.textColor=[UIColor yellowColor];
    downLable5.textColor=[UIColor redColor];
    downLable1.textColor=[UIColor colorWithRed:0.959 green:0.136 blue:1.000 alpha:1.000];
    downLable2.textColor=[UIColor colorWithRed:0.959 green:0.136 blue:1.000 alpha:1.000];
    downLable3.textColor=[UIColor colorWithRed:0.959 green:0.136 blue:1.000 alpha:1.000];
    downLable4.textColor=[UIColor colorWithRed:0.959 green:0.136 blue:1.000 alpha:1.000];
    downLable1.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[0]][0]];
    downLable2.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[1]][0]];
    downLable3.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[2]][0]];
    downLable4.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[3]][0]];
    downLable5.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[4]][0]];
    downLable6.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[5]][0]];
    upLable1.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[0]][1]];
    upLable2.text= [NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[1]][1]];
    upLable3.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[2]][1]];
    upLable4.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[3]][1]];
    upLable5.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[4]][1]];
    upLable6.text=[NSString stringWithFormat:@"%@",[NSArray arrayWithArray:_arr[5]][1]];
    twotitleLable.text=[dic3 objectForKey:@"block"];










}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
